//
//  SerOrderSubListCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/7/27.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "SerOrderSubListCell.h"

@implementation SerOrderSubListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code

}

- (void)fillCellWithModel:(OrderListModel *)model {
    
    OrderGoodsModel *goodsModel = model.userOrderGoodList.firstObject;
    
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:goodsModel.goodsImg] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.mainTitleLab.text = goodsModel.ogGoodsName;
    self.priceLab.text =[NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:goodsModel.ogTotal]];
}

- (void)fillCellWithRFModel:(RefundListModel *)model {
    
    OrderGoodsModel *goodsModel = model.userOrderGoodsList.firstObject;

    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:goodsModel.goodsImg] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.mainTitleLab.text = goodsModel.ogGoodsName;
    self.priceLab.text =[NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:goodsModel.ogTotal]];
}

-(void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.mainImageView pp_clipCorners:UIRectCornerAllCorners radius:6];
    });
    
}

@end
